UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RQE0QszkPOXO0vqw49Bz4jDU7ZXG/lgVR8z2FZMoxDE='
WHERE
key_id = 'c68dcd78c64308bad03b0917693784d485fe096b60405e4607d08782210c46c8'
AND (
token = 'RQE0QszkPOXO0vqw49Bz4jDU7ZXG/lgVR8z2FZMoxDE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)