UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+UOmPnE085jSt1v9aocMxq2GIUp5iGdTo91CnkK7R2Y=' 
WHERE 
  key_id = '44c2ca565a00124be0dea6c830d7db357cfa02bc1795a9dcd26c2bb84448e6bf' 
  AND (
    token = '+UOmPnE085jSt1v9aocMxq2GIUp5iGdTo91CnkK7R2Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020