UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rfqzzzXjpsjHgh+EnqpiufE8Xh5RD44FpUInGMGXRfg='
WHERE
key_id = '8aa30aaf3e67318dddf874adcf3b5e01b2cc72acbec2b7f7a01f43c985ccf235'
AND (
token = 'rfqzzzXjpsjHgh+EnqpiufE8Xh5RD44FpUInGMGXRfg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)