UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZhLx73BJn0f7ext8FGvjdllDBKJksxNjtQVuNw+68k8=' 
WHERE 
  key_id = '1e0f6d907d13b3259c66e33185d15965e01d6739c371cba4f2fff5fd49966c94' 
  AND (
    token = 'ZhLx73BJn0f7ext8FGvjdllDBKJksxNjtQVuNw+68k8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017