UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gE72bFOLEDKN7ZDMhS2R5jVje/uBi+7RauQmfKnY6ns='
WHERE
key_id = '572abef8ae10e25ac44129698928472736f7bd696586aa42e6ae90ba3e949bbd'
AND (
token = 'gE72bFOLEDKN7ZDMhS2R5jVje/uBi+7RauQmfKnY6ns='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)