UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PI1xLzPkMHtY2l4QhSVbJxZdLK4n2saRqBIUX7p6oDQ='
WHERE
key_id = 'c4a0c2db0ede5bf117dd960dea621bd4e3bc6f7085d2705b4a0414fd26009cfe'
AND (
token = 'PI1xLzPkMHtY2l4QhSVbJxZdLK4n2saRqBIUX7p6oDQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)