UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mWz7r+ZxL5376Dv5ao2VOupCgyK7iOphkniKDP9sVVg=' 
WHERE 
  key_id = '5fe0ddef66958ad7e69ae5a38fdea7f7950988ec2f87906c7a98d676f77f29a0' 
  AND (
    token = 'mWz7r+ZxL5376Dv5ao2VOupCgyK7iOphkniKDP9sVVg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045