UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z08QbYWyMB9QHdIL1XPZdvrOJWUY2vx9OMSwUSeUjZU='
WHERE
key_id = '0930002d91c1170fa77306e15e37f414c27c7b3438b99d83a8b1454c133a36c4'
AND (
token = 'Z08QbYWyMB9QHdIL1XPZdvrOJWUY2vx9OMSwUSeUjZU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)