UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bDfAA4IqQ9q1rA+jNXt4CDaA76sdB1rSovVD76Kg7gY=' 
WHERE 
  key_id = '5fd7c6bd51ca7c2a365bcae300a31e11419229f158c3818fae41d66198326d62' 
  AND (
    token = 'bDfAA4IqQ9q1rA+jNXt4CDaA76sdB1rSovVD76Kg7gY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029