UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cveVAd/5c+FycuzPZCUcaWS4OKhYKKZNIdFMWgivMNE='
WHERE
key_id = 'c0659b7b120f248c9693d8b6d0bb834a02b4a6007b74ca107539644bbbe92976'
AND (
token = 'cveVAd/5c+FycuzPZCUcaWS4OKhYKKZNIdFMWgivMNE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)