UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BZzuc72jFQrosJdMfFdNndcC5kXbKbAyeCEiRivXNaQ='
WHERE
key_id = '72626b3fbc45f05c389fb6eba5457795d68937303b61f26c706c1f3b8248f3f2'
AND (
token = 'BZzuc72jFQrosJdMfFdNndcC5kXbKbAyeCEiRivXNaQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)