UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GRbKckz4dBUScCxs3jHftqctDmvaMqQe//516EnbLvk=' 
WHERE 
  key_id = '0b61b8023821334ebcbed2e2bd27e637c31f09439e16ad5f7dcbd29e0818761d' 
  AND (
    token = 'GRbKckz4dBUScCxs3jHftqctDmvaMqQe//516EnbLvk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036