UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4LECvWMZ50QOICATwBJ4LnU9rULbjcvRuvnmKsGbnJ0='
WHERE
key_id = '7e9f0acb477eaf52dc2aaa50bcad65308a1fe9665422bd042d4a6bf06d6b9498'
AND (
token = '4LECvWMZ50QOICATwBJ4LnU9rULbjcvRuvnmKsGbnJ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)