UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PSSP/LbC0ZohHOd7DkSLW/5/2COHPhMJAFiuDmu4Ll8='
WHERE
key_id = 'c33f5acec7725e775ddce978ce36d237504eb2375057699a77eed6b0cc7f0158'
AND (
token = 'PSSP/LbC0ZohHOd7DkSLW/5/2COHPhMJAFiuDmu4Ll8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)