UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4fwItWG8IVlDjvU21zmvQLvVMW12ZecJOGmTBg+w8h8='
WHERE
key_id = 'ad55d47146dfecc5e133cdd6d7600622298713572442f76bafa05319005e1a48'
AND (
token = '4fwItWG8IVlDjvU21zmvQLvVMW12ZecJOGmTBg+w8h8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)