UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DjvT534h94onXiA7iEVp/7CdGb/imwfJFsH3bEdwv7M='
WHERE
key_id = 'ad634999e141d9de3cfabf27065065375c2b177c5d5e722cb42e580c69dd0089'
AND (
token = 'DjvT534h94onXiA7iEVp/7CdGb/imwfJFsH3bEdwv7M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)