UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/sF4HKFGcCe74+dbkF/krdRZcVuUdLZNdSJIbTnz7NI='
WHERE
key_id = '2b2bbffc4c2ee04777cc6b5e9d19d8edbf2f03bbc86a58badb59e2ef350e437b'
AND (
token = '/sF4HKFGcCe74+dbkF/krdRZcVuUdLZNdSJIbTnz7NI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)