UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '35BYjSlEYQe0uM4qrKg7IpCOP81RNtnWqVpI8cM7hzw=' 
WHERE 
  key_id = '6a2e09f20593c25e1c61b107faf5945eb1f3e312732570ac34057add8f8defd3' 
  AND (
    token = '35BYjSlEYQe0uM4qrKg7IpCOP81RNtnWqVpI8cM7hzw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042