UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hN9NvRrp42O7PPQFeDqWVw8wPD5plIZuNe/ANkjp390='
WHERE
key_id = '17ee4e55ee65702f77efa682a9b3460217edd44a844618e0d8146fa1ef4853cb'
AND (
token = 'hN9NvRrp42O7PPQFeDqWVw8wPD5plIZuNe/ANkjp390='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)