UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lcepkYuIZXjx7WWdEjlKN1T4UO0QzJzn7FmrrcWL0lc=' 
WHERE 
  key_id = '7b69108df92bbad14b1eaa93849681d03767bb4c67f75e699305cc6ff353323c' 
  AND (
    token = 'lcepkYuIZXjx7WWdEjlKN1T4UO0QzJzn7FmrrcWL0lc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057