UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z5NDHqW2dvQ6qR2/81JV0SFh3QPqdUdADVS6tL2UQvU='
WHERE
key_id = '4cc0543dbaa07b21f530800b511953bc3d1656b4df8383e7d3fa7f1edccaa554'
AND (
token = 'z5NDHqW2dvQ6qR2/81JV0SFh3QPqdUdADVS6tL2UQvU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)