UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '94dAbPMD7E4oS37+5odnUI+m4Y1BMJnqc4zWh7ajW5o='
WHERE
key_id = '7f7dcb52c99970184fcd8f128083a383aa52e83806fd2c3611f3eeb7702b0f9d'
AND (
token = '94dAbPMD7E4oS37+5odnUI+m4Y1BMJnqc4zWh7ajW5o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)