UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jby/76RvXPmOHkhRKPySw3hns4ovIg1GJyE9UevXWRU='
WHERE
key_id = 'cff0e23e5dc2a62ecb0b75567813ce4d39a6ac1db9be89dedcb9cd46bc5b635f'
AND (
token = 'jby/76RvXPmOHkhRKPySw3hns4ovIg1GJyE9UevXWRU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)