UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zs/7aG3oks4tuap+6wwmdt9eIOai4cyUatm6Nxt5gdA='
WHERE
key_id = 'bf2b1fcb969b536cbb6c7e7e5821f65988e3ac4f60839583f439c3d3f83568be'
AND (
token = 'zs/7aG3oks4tuap+6wwmdt9eIOai4cyUatm6Nxt5gdA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)