UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QOh5U0uXpxLTL89l6AwbTINM51t/NDJ2irmwo7FCEhg=' 
WHERE 
  key_id = 'aeb153b7d1c8a869981a16a6772aab848a6065669fbf7f6cc8bb5754ead34a3e' 
  AND (
    token = 'QOh5U0uXpxLTL89l6AwbTINM51t/NDJ2irmwo7FCEhg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033