UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bDXjUsKR1N74H8nmEBDRvsuesNrD8uIhkRwH7fMvJmU='
WHERE
key_id = '61f525377bba9b7afc0a7ed7404fc1b2e766ec75be708d8ed1202d7bbbf1f27f'
AND (
token = 'bDXjUsKR1N74H8nmEBDRvsuesNrD8uIhkRwH7fMvJmU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)