UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y2MWVWpusEtfkvuVJD5Wl+WRLCn/5yyAwYTfed+bXdg='
WHERE
key_id = '778034252d329cd72842a3cd6d982b5d854319f9e3ee45f071b296e62f29b89e'
AND (
token = 'y2MWVWpusEtfkvuVJD5Wl+WRLCn/5yyAwYTfed+bXdg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)