UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D6MwiRjGXmoQ/X/4XANFqC/VzoBKJDKBClF7BUXvq4o=' 
WHERE 
  key_id = '1c3b9fa087e416ee60efbc40556477fee45697fa6900a2f346a8d010461bab3e' 
  AND (
    token = 'D6MwiRjGXmoQ/X/4XANFqC/VzoBKJDKBClF7BUXvq4o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050