UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eqhnHPK2j0Ctpny9bMrmA4jbChb6x6ZdFuH36Vb05aA=' 
WHERE 
  key_id = '6338a229e89510e7db94240a8f9d9d292034f39e4780a5f48b03aa5bc521a24f' 
  AND (
    token = 'eqhnHPK2j0Ctpny9bMrmA4jbChb6x6ZdFuH36Vb05aA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016