UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9BSiUQpYxj3z5nMUhg2DuJxyn6p1iG/h3y0fYqTpZa4=' 
WHERE 
  key_id = '60289989270ab2a46cc650db89576a297efc858821cdf5b8e74a301202a665fe' 
  AND (
    token = '9BSiUQpYxj3z5nMUhg2DuJxyn6p1iG/h3y0fYqTpZa4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030