UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ug7MOXlanMfzfqC9y0XR59OLP2bA8gfFHHrjZ6NegPU=' 
WHERE 
  key_id = 'a4b26b51b3d8cc139f95699359c70a4da598eafbab40fd77bf267342388db8d9' 
  AND (
    token = 'Ug7MOXlanMfzfqC9y0XR59OLP2bA8gfFHHrjZ6NegPU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034