UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cKn28MJ7N+uxFMCBujqgXtNrEDthKQjKDi/a4JfKDoY='
WHERE
key_id = 'aa451280b505e11f1122f58341aa22308b96681641a9d8130612918309170bcd'
AND (
token = 'cKn28MJ7N+uxFMCBujqgXtNrEDthKQjKDi/a4JfKDoY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)