UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GRwMzD1re+6ixDjoM9LYY+aE9MGVh2VVGpVxStJc9i4=' 
WHERE 
  key_id = '85559856bb41a34dd285297a658fe883c31620428c68ba55890f6329431d8dad' 
  AND (
    token = 'GRwMzD1re+6ixDjoM9LYY+aE9MGVh2VVGpVxStJc9i4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052