UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm9NIpYgiHMmu65/ZN3+iYDFFMH7B0ft4Bk08F1v1Wew='
WHERE
key_id = '37ed876a2d5f6ad8354fe8c16ed12db07ccdeb46188905dc95bd2297209ae73f'
AND (
token = 'm9NIpYgiHMmu65/ZN3+iYDFFMH7B0ft4Bk08F1v1Wew='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)