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