UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ImyT78wmVk1xikmm0HA3XwV2hT4p0DoBeqHxT4kUapE='
WHERE
key_id = '6bdd5a7afad8fe99d3041b5bf5a77ab14a5f0414cac0044c36b6ea0cde2be05f'
AND (
token = 'ImyT78wmVk1xikmm0HA3XwV2hT4p0DoBeqHxT4kUapE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)