UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mxU+xLJBYtmDIs8rE3VmuHhfN6GRnTpBv2zqcyMpvx4='
WHERE
key_id = '71da2f1326d5d4028af73b1c23ca9c10e93350a12b6304839d9f8661901361c9'
AND (
token = 'mxU+xLJBYtmDIs8rE3VmuHhfN6GRnTpBv2zqcyMpvx4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)