UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6Lh1Oa5GBsIVKf2vL5g5L+CpVUWsEraOatiwI45vryY='
WHERE
key_id = '10eb8dc5817e3dc7b38e45cdf5bdcc176bf52f0e152cc940d83d6037af1ebc28'
AND (
token = '6Lh1Oa5GBsIVKf2vL5g5L+CpVUWsEraOatiwI45vryY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)