UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fX8VRuKz3i05FpK1CIAb55g+V2bTNDR8pTc0vScFdQ4=' 
WHERE 
  key_id = 'd6a11916b075c47138687a28eb947d35013d0b42f1e243e72e69d98f5152fe2c' 
  AND (
    token = 'fX8VRuKz3i05FpK1CIAb55g+V2bTNDR8pTc0vScFdQ4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045