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