UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l1adAEyxxO0L5DE84t17lxSOZak0Ps4WxzoGiCltN5U='
WHERE
key_id = '2b8cee9c257ed0d8cebf31030feecb21caac5c1f7561058489112f528de0a385'
AND (
token = 'l1adAEyxxO0L5DE84t17lxSOZak0Ps4WxzoGiCltN5U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)