UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MTFQfjtTrmtiBHVmiUqtM6Sp+stz962qg+i/sDzuIQI='
WHERE
key_id = 'eca2da78f1d22504a3f8fff5a95793369e987adddd4a7c911fa23baf4ad56750'
AND (
token = 'MTFQfjtTrmtiBHVmiUqtM6Sp+stz962qg+i/sDzuIQI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)