UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Gh29fc8bDtYP8GYCA5tfTfPFi7sUqb/BVf2c8DEGfNQ='
WHERE
key_id = '0e549a545a7c9fb6559aab40460c2e81c58def923e7352153e65c85e415311f2'
AND (
token = 'Gh29fc8bDtYP8GYCA5tfTfPFi7sUqb/BVf2c8DEGfNQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)